package top.kpromise.user.service_imp;

import org.springframework.stereotype.Service;
import top.kpromise.user.mapper.PermissionMapper;
import top.kpromise.user.model.response.UserPermission;
import top.kpromise.user.service.PermissionService;

import java.util.ArrayList;

@Service
public class PermissionServiceImp implements PermissionService {

    private final PermissionMapper permissionMapper;

    public PermissionServiceImp(PermissionMapper permissionMapper) {
        this.permissionMapper = permissionMapper;
    }

    @Override
    public ArrayList<UserPermission> permissionList(String userId, String appId) {
        return permissionMapper.permissionList(userId, appId);
    }

    @Override
    public int insert(String appId, String userId, String permission) {
        return permissionMapper.insert(appId, userId, permission);
    }

    @Override
    public int delete(int id) {
        return permissionMapper.delete(id);
    }
}
